home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2009 February / PCWFEB09.iso / Software / Linux / SLAX 6.0.8 / slax-6.0.8.iso / slax / base / 006-devel.lzm / usr / include / k3bplugin.h < prev    next >
Encoding:
C/C++ Source or Header  |  2008-05-27  |  2.5 KB  |  114 lines

  1. /* 
  2.  *
  3.  * $Id: k3bplugin.h 619556 2007-01-03 17:38:12Z trueg $
  4.  * Copyright (C) 2003 Sebastian Trueg <trueg@k3b.org>
  5.  *
  6.  * This file is part of the K3b project.
  7.  * Copyright (C) 1998-2007 Sebastian Trueg <trueg@k3b.org>
  8.  *
  9.  * This program is free software; you can redistribute it and/or modify
  10.  * it under the terms of the GNU General Public License as published by
  11.  * the Free Software Foundation; either version 2 of the License, or
  12.  * (at your option) any later version.
  13.  * See the file "COPYING" for the exact licensing terms.
  14.  */
  15.  
  16.  
  17. #ifndef _K3B_PLUGIN_H_
  18. #define _K3B_PLUGIN_H_
  19.  
  20. #include <qobject.h>
  21. #include <kgenericfactory.h>
  22. #include "k3b_export.h"
  23.  
  24. #define K3B_PLUGIN_SYSTEM_VERSION 3
  25.  
  26.  
  27. class K3bPluginConfigWidget;
  28. class QWidget;
  29.  
  30.  
  31.  
  32. class K3bPluginInfo
  33. {
  34.   friend class K3bPluginManager;
  35.  
  36.  public:
  37.   K3bPluginInfo() {
  38.   }
  39.  
  40.   K3bPluginInfo( QString libraryName,
  41.          QString name,
  42.          QString author,
  43.          QString email,
  44.          QString comment,
  45.          QString version,
  46.          QString licence )
  47.     : m_libraryName(libraryName),
  48.     m_name(name),
  49.     m_author(author),
  50.     m_email(email),
  51.     m_comment(comment),
  52.     m_version(version),
  53.     m_licence(licence) {
  54.   }
  55.  
  56.   const QString& name() const { return m_name; }
  57.   const QString& author() const { return m_author; }
  58.   const QString& email() const { return m_email; }
  59.   const QString& comment() const { return m_comment; }
  60.   const QString& version() const { return m_version; }
  61.   const QString& licence() const { return m_licence; }
  62.  
  63.   const QString& libraryName() const { return m_libraryName; }
  64.  
  65.  private:
  66.   QString m_libraryName;
  67.  
  68.   QString m_name;
  69.   QString m_author;
  70.   QString m_email;
  71.   QString m_comment;
  72.   QString m_version;
  73.   QString m_licence;
  74. };
  75.  
  76.  
  77. /**
  78.  * Base class for all plugins. You may use the K3bPluginFactory to make your plugin available.
  79.  */
  80. class LIBK3B_EXPORT K3bPlugin : public QObject
  81. {
  82.   Q_OBJECT
  83.  
  84.     friend class K3bPluginManager;
  85.  
  86.  public:
  87.   K3bPlugin( QObject* parent = 0, const char* name = 0 );
  88.   virtual ~K3bPlugin();
  89.  
  90.   const K3bPluginInfo& pluginInfo() const { return m_pluginInfo; }
  91.  
  92.   /**
  93.    * Version of the plugin system this plugin was written for.
  94.    */
  95.   virtual int pluginSystemVersion() const = 0;
  96.  
  97.   /**
  98.    * The plugin group.
  99.    */
  100.   virtual QString group() const = 0;
  101.  
  102.   /**
  103.    * Returns a widget which configures the plugin.
  104.    *
  105.    * The caller has to destroy the widget
  106.    */
  107.   virtual K3bPluginConfigWidget* createConfigWidget( QWidget* parent = 0, const char* name = 0 ) const;
  108.  
  109.  private:
  110.   K3bPluginInfo m_pluginInfo;
  111. };
  112.  
  113. #endif
  114.